﻿@using PagedList;
@using PagedList.Mvc;

@model IPagedList<Project_2._2.Models.Xe>
@{
    ViewBag.Title = "Default";
    Layout = "~/Views/Shared/_AdminLayoutPage.cshtml";
}
<link href="~/Content/Admin-content-right.css" rel="stylesheet" />
<style type="text/css">
    .paging {
        text-decoration: none;
        font-weight: bold;
        color: #ffffff;
        font-size: 15px;
        padding-right: 3px;
    }

        .paging:hover {
            color: #d40303;
        }

    .phan_trang {
        text-decoration: none;
        font-weight: bold;
        color: #ffffff;
        font-size: 15px;
        text-align: right;
        padding-top: 10px;
    }

    .mau_chu {
        color: #00ff21;
    }
</style>

<div class="grid_12">
    <div class="block-border">
        <div class="block-header">
           Quản Lý Xe Cho Thuê
          @Html.ActionLink("Thêm Mới", "Create", "Advertise", null, new { @class = "button" }) 
         <a href="#divUploadedFiles" class="button">Tìm Kiếm</a>
        </div>
        <div class="block-content">
           
            @using (Html.BeginForm("Multi_Delete", "Feedback", FormMethod.Post))
            {
                <table class="table dataTable-useSiteDefaults">
                    <thead>
                        <tr>
                            <th>Chọn</th>
                            <th style="width:70px">Tên Xe </th>
                            <th>đời xe</th>
                            <th>Màu xe</th>
                            <th>Phụ Trợ Ngoài Giờ</th>
                            <th>Phụ Trợ Quá Km</th>
                            <th>Phụ Trợ Cuối Tuần</th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (var cars in Model)
                        {
                            <tr>
                                <td style="text-align:center"><input type="checkbox" name="feedbackIdsToDelete" id="feedbackIdsToDelete" value="@cars.XeId"></td>
                                <td>@cars.TenXe</td>
                                <td>@cars.DoiXe</td>
                                <td>@cars.MauXe</td>
                                <td>@cars.PhuTroNgoaiGio</td>
                                <td>@cars.PhuTroQuaKm</td>
                                <td>@cars.SuDungCuoiTuan</td>
                                @*<td style="width:70px">@String.Format("{0:dd/MM/yyyy}", feedback.NgayGui)</td>*@
                                <td style="width:70px">
                                    <a class="tableActionButton check" rel="tooltip-top" title="Đăng" href="../Feedback/Accept/@cars.XeId"></a>

                                    <a class="tableActionButton delete" rel="tooltip-top" title="Hủy" href="../Feedback/Delete/@cars.XeId" onclick="return DeleteConfirm()"></a>
                                </td>
                            </tr>
                        }
                    </tbody>

                </table>
                <input type="submit" value=" Xóa Tùy Chọn " onclick="return DeleteConfirm()" />
            }
        </div>
        @*@Html.PagedListPager(Model, page => Url.Action("Default", new { page }))*@

        <div class="phan_trang">
            Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber)
            of @Model.PageCount

            @if (Model.HasPreviousPage)
            {
                @Html.ActionLink("<< ", "Default", new { page = 1 }, new { @class = "paging" })
                @Html.Raw("  ");
                @Html.ActionLink(" Prev", "Default", new { page = Model.PageNumber - 1 }, new { @class = "paging" })
            }
            else
            {
                @:<<
                @Html.Raw("  ");
                @:< Prev
            }

            @if (Model.HasNextPage)
            {
                @Html.ActionLink("Next ", "Default", new { page = Model.PageNumber + 1 }, new { @class = "paging" })
                @Html.Raw(" ");
                @Html.ActionLink(" >>", "Default", new { page = Model.PageCount }, new { @class = "paging" })
            }
            else
            {
                @:Next >
                @Html.Raw("  ");
                @:>>
            }
        </div>
    </div>
</div>



<script>

    function DeleteConfirm() {
        if (confirm("Bạn có thật sự muốn xóa không?"))
            return true;
        else
            return false;
    }
</script>